using HMCollada.Core;
using System.Xml;

namespace HMCollada.Core {
    internal struct HMColladaContributor {
        internal string author;
        internal string authoring_tool;
        internal string comments;
        internal string copyright;
        internal string source_data;
    }
}

namespace HMCollada {
    internal partial class HMColladaLoader {
        private static HMColladaContributor LoadContributor() {
            HMColladaContributor newContributor = new HMColladaContributor();

            if (!colladaReader.IsEmptyElement) colladaReader.Read();
            do {
                if (colladaReader.NodeType != XmlNodeType.EndElement) {
                    switch (colladaReader.Name) {
                        case "author": newContributor.author = ReadString().Trim(); break;
                        case "authoring_tool": newContributor.authoring_tool = ReadString().Trim(); break;
                        case "comments": newContributor.comments = ReadString().Trim(); break;
                        case "copyright": newContributor.copyright = ReadString().Trim(); break;
                        case "source_data": newContributor.source_data = ReadString().Trim(); break;
                    }
                }

                if (!colladaReader.IsEmptyElement) colladaReader.Read();
            } while (colladaReader.Name != "contributor");

            if (colladaReader.IsEmptyElement) colladaReader.Read();
            return newContributor;
        }
    }
}